// create dataBase
var createDB = function (tx){
	// create transport table
	var sql = "CREATE TABLE IF NOT EXISTS DB_TRANSPORT(";
	sql += "id                int               NOT NULL,"
	sql += "companycode       varchar(500)      NULL,";
	sql += "companyname       varchar(4000)     NULL";
	sql += ")";
	tx.executeSql(sql);
	
	//create checkItem table
	var sql = "CREATE TABLE IF NOT EXISTS DB_CHECKITEM(";
	sql += "id                int               NOT NULL,";
	sql += "checkitem         varchar(4000)     NULL";
	sql += ")";
	tx.executeSql(sql);
	
	//create CheckItemCarType table
	var sql = "CREATE TABLE IF NOT EXISTS DB_CHECKITM_CARTYPE(";
	sql += "id                int               NOT NULL,";
	sql += "cartypeid         int               NOT NULL,";
	sql += "checkitemid       int               NOT NULL,";
	sql += "questionno        int               NULL,"
	sql += "score             int               NULL";
	sql += ")";
	tx.executeSql(sql);
	
	//create cartype table
	var sql = "CREATE TABLE IF NOT EXISTS DB_CARTYPE(";
	sql += "id                int               NOT NULL,";
	sql += "cartypecode       varchar(500)      NULL,";
	sql += "cartypename       varchar(500)      NULL";
	sql += ")";
	tx.executeSql(sql);
	
	//create warehouse table
	var sql = "CREATE TABLE IF NOT EXISTS DB_WAREHOUSE(";
	sql += "storecode        varchar(500)       NULL,";
	sql += "storename        varchar(500)       NULL";
	sql += ")";
	tx.executeSql(sql);
	
	//create warehouseCarType table
	var sql = "CREATE TABLE IF NOT EXISTS DB_WAREHOUSE_CARTYPE(";
	sql += "cartypeid        int                NOT NULL,";
	sql += "storecode        varchar(500)       NOT NULL";
	sql += ")";
	tx.executeSql(sql);

    //create notsubmitlist table
    var sql = "CREATE TABLE IF NOT EXISTS DB_NOTSUBMIT(";
        sql += "actno          varchar(500)       NOT NULL,";
        sql += "notSubmitLists   varchar(1000)       NOT NULL";
        sql += ")";
    tx.executeSql(sql);

    //create requestRevise table
    var sql = "CREATE TABLE IF NOT EXISTS DB_REVISELIST(";
    sql += "actno      varchar(500)       NOT NULL,";
    sql += "changeLists   varchar(1000)       NOT NULL";
    sql += ")";
    tx.executeSql(sql);
}

var successDB = function(){
	console.log("DBsuccess");
}

var errorDB = function(err){
	console.log(err);
}